﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using ITProject.Domain.Entities;
using System.ComponentModel.DataAnnotations;

namespace ITProject.WebUI.Models.ProjectTeamLeader
{
    public class ProjectTeamLeaderIndexViewModel
    {
        [Display(Name="Nazwa zespołu")]
        public string TeamName { get; set; }

        // ukryty parametr
        public int TeamId { get; set; }

        public static ProjectTeamLeaderIndexViewModel[] Convert(Team[] teams)
        {
            ProjectTeamLeaderIndexViewModel[] vmTab = new ProjectTeamLeaderIndexViewModel[teams.Length];
            for (int i = 0; i < vmTab.Length; i++)
            {
                vmTab[i] = new ProjectTeamLeaderIndexViewModel();
                vmTab[i].TeamId = teams[i].Id;
                vmTab[i].TeamName = teams[i].Name;
            }
            return vmTab;
        }
    }
}